# File：orm_test.py
# Author：信思智学
# Date ：2025/8/11 10:32
# Info：

import os
if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DjangoORM20250807.settings")
    import django
    django.setup()

    from app.models import User

    # 属性__gt  >
    # 属性__gte >=
    # 属性__lt  <
    # 属性__lte <=
    # 属性__gt=1,属性__lt=5      select * from t_user where id > 1 and id < 5
    # 属性__range=[1,3]    id>=1 and id <=3
    # 属性__in=[1,3]       select * from t_user where id = 1 or id = 3
    # 属性__contains    模糊匹配 like  %路%  匹配英文区分大小写
    # 属性__icontains    模糊匹配 like  %路%  匹配英文不区分大小写
    # 属性__startswith="路"   模糊匹配 like  路%
    # 属性__endswith="路"   模糊匹配 like  %路
    #

    # userlist = User.objects.filter(id__gt=1,id__lte=3)
    # userlist = User.objects.filter(id__range=[1,3])

    # userlist = User.objects.filter(id__in=[1,3])

    userlist = User.objects.filter(username__contains="LU")

    print(userlist)












